Tin Tức

Cách dùng Raspberry Pi + Pi-hole để chặn quảng cáo cho tất cả thiết bị trong nhà

Pi-hole là một công cụ biến con Raspberry Pi của bạn thành một bộ chặn quảng cáo có tác dụng trên toàn bộ mạng trong nhà. Bạn không cần phải cài adblock, bạn không cần phải chỉnh DNS trên từng thiết bị, tất cả đã có Pi-hole lo. Cái này rất hữu ích với cả những thiết bị mà bạn không thể can thiệp để chặn quảng cáo, như Smart TV chẳng hạn. Bạn có thể tưởng tượng lúc đó chiếc Raspberry Pi sẽ đóng vai trò lọc hết mọi mẩu quảng cáo trước khi chúng kịp đến với điện thoại, máy tính của bạn. Cách làm cũng cực kì dễ, và bạn có thể dùng gần như mọi chiếc Raspberry Pi từ đó đến nay để chạy Pi-hole do nó không đòi hỏi cấu hình cao.

Lợi ích của việc dùng Pi-hole

  • Dễ cài đặt
  • Chặn được quảng cáo trên mọi thiết bị, mọi ứng dụng (kể cả các thiết bị không cho phép cài adblock)
  • Tốc độ cao, nhẹ nhàng
  • Dễ dàng kiểm soát nhờ giao diện đồ họa
  • Có thể chặn cả IPv4 và IPv6 của các trang quảng cáo
  • Miễn phí

Nguyên tắc hoạt động của nó như sau:

Để thực hiện, bạn cần có

  • Một chiếc Raspberry Pi, thẻ microSD, đã cài đặt hệ điều Raspbian Lite
  • Không bắt buộc, nhưng nên có: dây mạng LAN, để nối Pi với router bằng mạng có dây thì sẽ ổn định hơn
  • Bạn cũng phải làm quen với việc gõ lệnh trên Raspberry Pi, có thể làm trực tiếp trên Pi khi đã nối ra màn hình, bàn phím… hoặc dùng SSH cũng được (SSH thì tiện hơn, nhưng nếu chưa quen thì có thể hơi phức tạp.

Các bước cài Pi hole lên Raspberry Pi

Bạn truy cập vào Raspberry Pi của nhà bạn, có thể mở Pi ra, kết nối với màn hình, bàn phím, sau đó tìm ứng dụng tên là Terminal.

Chạy nó lên, gõ lệnh sau:

Code:
curl -sSL https://install.pi-hole.net | bash

Từ đây về sau thì bạn chỉ cần nhấn Enter để đồng ý mà thôi, không cần tùy chỉnh gì thêm vì những cái mà đã được chọn sẵn đều tốt cả. Sơ lược quá trình cài đặt thì câu lệnh trên sẽ làm những thứ như thế này:

  • Cài đặt Pi hole
  • Thiết lập IP tĩnh cho Raspberry Pi (vì phải có IP tĩnh trong mạng nội bộ thì router mới biết 1 chỗ cố định nhằm lọc link của các nhà quảng cáo)
  • Cài đặt giao diện web quản lý lưu lượng và theo dõi các chỉ số

Ở bước gần cuối, bạn sẽ thấy một màn hình tóm tắt của Raspberry Pi hiển thị địa chỉ IP của máy (mục IPv4). Nhớ ghi số này lại vì bạn sẽ cần cập nhật nó lên router của nhà mình. Như trong hình bên dưới, con Pi của mình có địa chỉ là 192.168.3.109.

Khi đã cài xong, bạn cần vào router của nhà mình để chỉnh lại DNS, còn gọi là máy chủ phân giải tên miền (ví dụ, gõ tinhte.vn -> trình duyệt biết địa chỉ thực sự là 123.223.14.15). Vì Pi hole sẽ can thiệp vào giai đoạn phân giải này nên nó có thể phát hiện được tên miền của các hãng quảng cáo, lấy đại 1 ví dụ như ads.google.com, vậy là nó sẽ block cái địa chỉ này lại và mẫu quảng cáo không thể hiển thị lên máy tính, di động, iPad hay Smart TV của bạn.

Mỗi router sẽ có cách chỉnh DNS khác nhau, nhưng về cơ bản thì bạn cứ tìm chỗ nào có chữ DNS hoặc chữ DHCP và DNS thì chỉnh ở đó, chuyển sang Set DNS Manually. Như hình minh họa bên dưới là mình chỉ trên con router nhà mình. Sau khi chỉnh xong thì lưu lại và khởi động lại router để nó bắt đầu có hiệu lực.

Sau khi đã cài đặt DNS cho router và khởi động lại, kể từ lần truy cập sau đó bạn sẽ thấy các mẫu quảng cáo không thể hiện thị được, một số trang sẽ bị trống vài chỗ, đó thực chất là chỗ quảng cáo nhưng banner, link và các thông tin đã bị Pi hole chặn rồi.

Pi hole có một trang điều khiển, quản lý, theo dõi thông số về việc truy cập và chặn quảng cáo, bạn có thể truy cập vào nó bằng link http://<địa chỉ IP của Raspberry Pi>/admin/index.php. Phần này thì mấy bạn tự mò nhé, cũng không có gì phức tạp và cần giới thiệu.

Một số lưu ý

Nếu ở lần đầu tiên cài đặt Pi-hole qua SSH (cài trực tiếp trên Pi không qua SSH thì sẽ không bị) mà bạn thấy Pi bị đứng, không thể SSH, không thể làm gì, thì khả năng cao là bạn chỉ bị mất lệnh SSH thôi chứ chặn quảng cáo thì vẫn chạy.

Trong trường hợp này, bạn làm như sau:

  1. Chờ khoảng 10p
  2. Nếu vẫn còn đơ, hãy rút điện, bật lại Pi
  3. Chạy lại dòng lệnh ở trên thêm 1 lần nữa, lần này bạn sẽ thành công

Lưu ý từ việc chặn quảng cáo

Một số trang hoạt động không thu phí, do đó họ cần nguồn thu từ các đơn vị quảng cáo như Google, Facebook, các hệ thống quảng cáo trong nước… để có kinh phí hoạt động. Trước khi chặn quảng cáo, hãy nghĩ về điều đó nhé. Hiện tại doanh thu từ các quảng cáo kiểu banner này không phải là phần quan trọng của Tinh tế, nhưng nhiều web khác thì có, nên bạn hãy chịu khó xem ads một chút để có động lực cho họ tạo nội dung cho bạn xem.

Related posts

98 Thoughts to “Cách dùng Raspberry Pi + Pi-hole để chặn quảng cáo cho tất cả thiết bị trong nhà”

  1. Embryos were staged by morphological characteristics according to Iwamatsu et al z pack use

  2. where can i buy cialis on line This is often the surgical team, particularly in patients who do not need to see a clinical oncologist to discuss radiotherapy

  3. The issue in the instant appeal as to the trigger of the 180 day exclusivity period is limited to whether any court decision is sufficient to trigger 355 j 5 B iv II s court decision trigger propecia long term side effects

  4. priligy 30mg price This impairment in circulatory function results from accentuation of arterial vasodilation already present in these patients

  5. de Placido 3, M best place to buy cialis online reviews Resolution of tremors in some cases with alcohol lends evidence to this functional disturbance hypothesis

  6. Magnificent web site. Plenty of useful info here. I’m sending it to some pals ans additionally sharing in delicious. And certainly, thanks in your effort!

  7. Good info. Lucky me I reach on your website by accident, I bookmarked it.

  8. cialis coupons i have no comment on the 6bromo as im not sure how you would dose that as well

  9. C4 and C5 inhibited tamoxifen resistant MCF 7 cells with equal potency IC 50 4 8 Ој M and efficacy 90 inhibition of viability and migration but demonstrated increased potency IC 50 80 211 Ој M and efficacy 140 inhibition to inhibit migration versus cell viability IC 50 181 304 mM; efficacy 80 inhibition in TU BcX 4IC cells real cialis online

  10. Great post. I was checking continuously this blog and I am impressed! Extremely useful info specially the last part 🙂 I care for such info much. I was seeking this certain info for a very long time. Thank you and good luck.

  11. It is really a great and helpful piece of info. I am glad that you shared this useful info with us. Please keep us informed like this. Thanks for sharing.

  12. Perfectly indited content, Really enjoyed looking through.

  13. Great write-up, I am normal visitor of one?¦s web site, maintain up the nice operate, and It’s going to be a regular visitor for a lengthy time.

  14. Thank you for any other great post. The place else may anybody get that kind of info in such an ideal method of writing? I have a presentation subsequent week, and I’m on the search for such information.

  15. I’ve been absent for some time, but now I remember why I used to love this site. Thanks, I’ll try and check back more frequently. How frequently you update your website?

  16. Outstanding post, I conceive blog owners should acquire a lot from this blog its very user pleasant.

  17. I genuinely enjoy looking through on this site, it has good blog posts.

  18. Whats up are using WordPress for your blog platform? I’m new to the blog world but I’m trying to get started and create my own. Do you need any html coding expertise to make your own blog? Any help would be greatly appreciated!

  19. Very interesting info !Perfect just what I was searching for!

  20. Super-Duper website! I am loving it!! Will come back again. I am taking your feeds also.

  21. Hello my friend! I wish to say that this post is amazing, nice written and include almost all important infos. I would like to see more posts like this.

  22. Thankyou for helping out, fantastic information.

  23. Thank you a lot for sharing this with all of us you actually recognize what you’re speaking approximately! Bookmarked. Kindly additionally discuss with my website =). We could have a hyperlink change contract between us!

  24. Hey There. I discovered your blog the usage of msn. This is an extremely well written article. I will be sure to bookmark it and return to learn more of your helpful information. Thank you for the post. I will definitely comeback.

  25. Perfect work you have done, this internet site is really cool with good information.

  26. I like this post, enjoyed this one appreciate it for posting.

  27. Nice post. I learn something more challenging on different blogs everyday. It will always be stimulating to read content from other writers and practice a little something from their store. I’d prefer to use some with the content on my blog whether you don’t mind. Natually I’ll give you a link on your web blog. Thanks for sharing.

  28. I really enjoy studying on this site, it contains fantastic posts.

  29. wonderful issues altogether, you just won a new reader. What would you recommend in regards to your put up that you just made some days ago? Any certain?

  30. Tonic Greens: An Overview. Introducing Tonic Greens, an innovative immune support supplement

  31. Hi my loved one! I wish to say that this post is amazing, great written and include approximately all important infos. I would like to peer more posts like this .

  32. Hello! This post could not be written any better! Reading this post reminds me of my previous room mate! He always kept chatting about this. I will forward this write-up to him. Pretty sure he will have a good read. Many thanks for sharing!

  33. Hey There. I found your blog using msn. This is an extremely well written article. I will be sure to bookmark it and come back to read more of your useful information. Thanks for the post. I will certainly comeback.

  34. I found your blog website on google and test a couple of of your early posts. Proceed to maintain up the very good operate. I simply additional up your RSS feed to my MSN Information Reader. Looking for forward to reading extra from you afterward!…

  35. There is obviously a bunch to identify about this. I feel you made certain good points in features also.

  36. I really like your writing style, fantastic information, regards for posting :D. “Your central self is totally untouched By grief, confusion, desperation.” by Vernon Howard.

  37. One such software that has been generating buzz these days is the Lottery Defeater

  38. I?¦ve been exploring for a little for any high-quality articles or weblog posts in this kind of area . Exploring in Yahoo I ultimately stumbled upon this site. Reading this info So i am glad to exhibit that I’ve an incredibly just right uncanny feeling I discovered just what I needed. I most indisputably will make certain to don?¦t forget this site and give it a look regularly.

  39. When I initially commented I clicked the “Notify me when new comments are added” checkbox and now each time a comment is added I get four e-mails with the same comment. Is there any way you can remove people from that service? Thanks!

  40. It’s a shame you don’t have a donate button! I’d without a doubt donate to this outstanding blog! I guess for now i’ll settle for bookmarking and adding your RSS feed to my Google account. I look forward to new updates and will share this blog with my Facebook group. Talk soon!

  41. Thanks a bunch for sharing this with all of us you really know what you are talking about! Bookmarked. Kindly also visit my site =). We could have a link exchange contract between us!

  42. I am not positive the place you are getting your information, but great topic. I needs to spend some time finding out much more or understanding more. Thanks for fantastic info I was searching for this info for my mission.

  43. This is the right blog for anyone who wants to find out about this topic. You realize so much its almost hard to argue with you (not that I actually would want…HaHa). You definitely put a new spin on a topic thats been written about for years. Great stuff, just great!

  44. Just what I was looking for, regards for putting up.

  45. FitSpresso: What Is It? FitSpresso is a natural weight loss aid designed for individuals dealing with stubborn weight gain. It is made using only science-backed natural ingredients.

  46. With havin so much written content do you ever run into any problems of plagorism or copyright infringement? My website has a lot of completely unique content I’ve either authored myself or outsourced but it appears a lot of it is popping it up all over the internet without my authorization. Do you know any techniques to help stop content from being stolen? I’d definitely appreciate it.

  47. I and also my buddies ended up following the best tricks found on your web page and so before long I got an awful feeling I had not expressed respect to the website owner for those tips. Those people came as a result passionate to read them and have truly been enjoying those things. Many thanks for getting really helpful and also for making a choice on certain incredible issues millions of individuals are really wanting to discover. Our own honest regret for not expressing appreciation to sooner.

  48. I have learn a few just right stuff here. Definitely price bookmarking for revisiting. I wonder how so much attempt you set to make this type of fantastic informative web site.

  49. Hello there, You’ve done a great job. I will certainly digg it and personally suggest to my friends. I’m sure they will be benefited from this website.

  50. As a Newbie, I am constantly exploring online for articles that can aid me. Thank you

  51. hello there and thank you to your information – I’ve certainly picked up anything new from proper here. I did however expertise a few technical issues the usage of this website, as I experienced to reload the website a lot of times previous to I could get it to load properly. I were thinking about if your web hosting is OK? Not that I’m complaining, however sluggish loading cases instances will often impact your placement in google and could injury your high quality score if ads and ***********|advertising|advertising|advertising and *********** with Adwords. Anyway I am including this RSS to my email and can glance out for much extra of your respective fascinating content. Make sure you replace this again very soon..

  52. I regard something truly special in this web site.

  53. Heya i’m for the first time here. I found this board and I find It really useful & it helped me out much. I hope to give something back and aid others like you helped me.

  54. Your style is so unique compared to many other people. Thank you for publishing when you have the opportunity,Guess I will just make this bookmarked.2

  55. It is really a great and useful piece of info. I?¦m happy that you shared this useful information with us. Please stay us informed like this. Thanks for sharing.

  56. What Is LeanBiome? LeanBiome is a natural dietary supplement that promotes healthy weight loss.

  57. I definitely wanted to compose a quick comment to be able to say thanks to you for some of the superb tips and tricks you are sharing at this site. My rather long internet look up has now been recognized with wonderful strategies to exchange with my family and friends. I ‘d mention that we site visitors are undoubtedly lucky to exist in a magnificent website with so many outstanding individuals with very beneficial hints. I feel rather grateful to have come across your web site and look forward to some more brilliant minutes reading here. Thank you once more for all the details.

  58. Thanks a bunch for sharing this with all people you actually recognize what you’re talking about! Bookmarked. Please also discuss with my web site =). We can have a link alternate contract among us!

  59. I just like the helpful information you supply for your articles. I will bookmark your weblog and check once more here frequently. I’m moderately sure I’ll learn lots of new stuff right right here! Best of luck for the following!

  60. Magnificent beat ! I wish to apprentice at the same time as you amend your site, how can i subscribe for a blog website? The account aided me a acceptable deal. I had been tiny bit familiar of this your broadcast offered vibrant clear concept

  61. I am always searching online for articles that can aid me. Thank you!

  62. I am glad to be a visitor of this perfect site! , appreciate it for this rare info ! .

  63. Great post, I believe blog owners should learn a lot from this site its really user genial.

  64. Thank you for the sensible critique. Me and my neighbor were just preparing to do a little research on this. We got a grab a book from our local library but I think I learned more from this post. I’m very glad to see such great info being shared freely out there.

  65. Nice read, I just passed this onto a colleague who was doing a little research on that. And he actually bought me lunch as I found it for him smile So let me rephrase that: Thank you for lunch! “Dreams are real while they last. Can we say more of life” by Henry Havelock Ellis.

  66. Neat blog! Is your theme custom made or did you download it from somewhere? A theme like yours with a few simple tweeks would really make my blog jump out. Please let me know where you got your design. Thank you

  67. Absolutely pent content, Really enjoyed studying.

  68. You made some good points there. I did a search on the issue and found most guys will go along with with your site.

  69. Nice blog here! Also your web site loads up very fast! What host are you using? Can I get your affiliate link to your host? I wish my web site loaded up as quickly as yours lol

  70. Thanks for the sensible critique. Me and my neighbor were just preparing to do a little research on this. We got a grab a book from our local library but I think I learned more clear from this post. I am very glad to see such fantastic information being shared freely out there.

  71. Magnificent web site. Lots of useful information here. I am sending it to some friends ans additionally sharing in delicious. And naturally, thank you for your sweat!

  72. Hi my friend! I want to say that this post is awesome, great written and include approximately all significant infos. I’d like to peer more posts like this.

  73. There is visibly a bunch to realize about this. I think you made some good points in features also.

  74. Greetings! I’ve been following your blog for a while now and finally got the bravery to go ahead and give you a shout out from Huffman Tx! Just wanted to say keep up the good work!

  75. Woh I like your posts, saved to my bookmarks! .

  76. Very interesting info!Perfect just what I was searching for!

  77. I genuinely enjoy reading on this website , it has got fantastic content. “For Brutus is an honourable man So are they all, all honourable men.” by William Shakespeare.

  78. I got what you intend, regards for putting up.Woh I am happy to find this website through google.

  79. I am delighted that I found this web site, just the right information that I was looking for! .

  80. You actually make it seem so easy together with your presentation however I to find this matter to be really something which I believe I might by no means understand. It seems too complicated and very huge for me. I am looking forward for your next post, I will try to get the cling of it!

  81. Your article helped me a lot, is there any more related content? Thanks! https://www.binance.com/es-MX/register?ref=JHQQKNKN

  82. My husband and I invested $250 in a promising opportunity we found online. Our initial investment quickly grew by 30%, prompting us to increase our stake to $97,700 over time. However, when we tried to withdraw our profits, we were surprised by a 40% upfront commission demand. Unable to meet this unexpected requirement, I sought advice from friends who recommended professional help. I contacted SWIFT_HACKING on Telegram, sharing all the investment details. Fortunately, SWIFT_HACKING intervened effectively, recovering our initial investment and profits. Their support was crucial during a challenging period. For anyone facing a similar situation, seeking expert assistance is vital. Email: (swiftrecoveryservice006@gmail .com) WhatsApp: +1 (786) 684‑0501 Website https://swiftspyassetsrecovery.com

  83. Some really superb posts on this site, appreciate it for contribution.

  84. I enjoy examining and I conceive this website got some really useful stuff on it! .

  85. This is a very good tips especially to those new to blogosphere, brief and accurate information… Thanks for sharing this one. A must read article.

  86. Heya! I’m at work browsing your blog from my new apple iphone! Just wanted to say I love reading through your blog and look forward to all your posts! Keep up the great work!

  87. It does not take long for a vicious cycle to set in priligy medication

  88. That is a very good tip especially to those new to the
    blogosphere. Brief but very accurate information… Many thanks for sharing this one.
    A must read article!

  89. Your point of view caught my eye and was very interesting. Thanks. I have a question for you.

  90. Your point of view caught my eye and was very interesting. Thanks. I have a question for you.

  91. Thanks for sharing. I read many of your blog posts, cool, your blog is very good.

  92. Your article helped me a lot, is there any more related content? Thanks!

  93. Keep working ,fantastic job!

  94. I have been browsing online more than three hours today, yet I never found any interesting article like yours. It is pretty worth enough for me. In my opinion, if all site owners and bloggers made good content as you did, the net will be much more useful than ever before.

  95. Thank you for your sharing. I am worried that I lack creative ideas. It is your article that makes me full of hope. Thank you. But, I have a question, can you help me?

  96. Can you be more specific about the content of your article? After reading it, I still have some doubts. Hope you can help me.

  97. Your article helped me a lot, is there any more related content? Thanks!

  98. Thank you for your sharing. I am worried that I lack creative ideas. It is your article that makes me full of hope. Thank you. But, I have a question, can you help me? https://accounts.binance.com/en-IN/register?ref=UM6SMJM3

Leave a Comment